<?php
/**
 *             
 */

class EveryGradeController extends AdminBaseController {

	
	public function grade(){
		$this->setTitle('实时等级流失');
	
		$filter = new PubFilter();
		$grid   = new PubGrid();
	
		$lod_special_id = $this->R('special_id');
		$lodos = $this->R('os');
		$filter->addSpecialFilter(false,2);
		$filter->addOsFilter($lod_special_id,true,2)
        ->addServerFilter($lod_special_id,$lodos,true,false,2);
		
	
		$params = $filter->get();
		
		$params = $this->indexCommon($params);

		$header = EveryGradeService::gradeHeader($params);
		$data   = EveryGradeService::gradeData($params);
	
		if($filter->isExport()){
			$filename = LibExcel::getFilename('实时等级流失', $params);
			LibExcel::exportCsv($header, $data, $filename);
		}else{
			$grid->addGrid($header, $data, array(
					'name'  => '实时等级流失',
					'length'=>200,
					'fix'   => array(
							'col' => 1
					)
					//'order' => array('Level', 'desc')
			));
	
			$this->out['filter'] = $filter->show();
			$this->out['grid'] = $grid->show();
			$this->out['is_ana'] = 2;
		}
	}
	
	

    
} 